package Exer04_循环;

import java.util.Scanner;

public class _1_4_6_正整数分解质因数 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入一个数，判断是否为素数:");
        int num = scanner.nextInt();
        int k;
        System.out.print(num + "=");
        for (k = 2; k <= num; k++) {
            if (num % k == 0 && (num < k || num > k)){
                    System.out.print(k + "*");
                    num = num/k;
                    k = 2;
            }
        }
        System.out.println(num);
        scanner.close();
    }
}
